package com.cardone.platform.usercenter.service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;


import lombok.Getter;


import lombok.Setter;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.transaction.annotation.Transactional;

import com.cardone.common.dto.PaginationDto;
import com.cardone.common.cache.Caches;
import com.cardone.context.Attributes;
import com.cardone.context.ContextHolder;
import com.cardone.common.util.EntityUtils;
import com.cardone.platform.usercenter.dao.UsDepartmentTranslateDao;
import com.cardone.platform.usercenter.dto.UsDepartmentTranslateDto;

/**
 * 用户部门调动服务
 *
 * @author yaohaitao
 * 
 */
@Getter 
@Setter
@Transactional(readOnly = true)
public class UsDepartmentTranslateDefaultService implements UsDepartmentTranslateService {
	@Override
	@Transactional
	public <P> P saveByIdOrCode(Class<P> mappedClass, UsDepartmentTranslateDto saveUsDepartmentTranslate) {
		return ContextHolder.getBean(UsDepartmentTranslateDao.class).saveByIdOrCode(mappedClass, saveUsDepartmentTranslate);
	}
	
	@Override
	@Transactional
	public UsDepartmentTranslateDto saveByIdOrCode(UsDepartmentTranslateDto saveUsDepartmentTranslate) {
		return ContextHolder.getBean(UsDepartmentTranslateDao.class).saveByIdOrCode(UsDepartmentTranslateDto.class, saveUsDepartmentTranslate);
	}
	
	@Override
	public <P> P findByCodeOrId(Class<P> mappedClass, UsDepartmentTranslateDto findUsDepartmentTranslate) {
		return ContextHolder.getBean(UsDepartmentTranslateDao.class).findByCodeOrId(mappedClass, findUsDepartmentTranslate);
	}
	
	@Override
	public Integer readByCodeNqIdForCount(UsDepartmentTranslateDto readUsDepartmentTranslate) {
		return ContextHolder.getBean(UsDepartmentTranslateDao.class).readByCodeNqIdForCount(readUsDepartmentTranslate);
	}
	
	@Override
	@Transactional
	public int insertByCode(UsDepartmentTranslateDto insertUsDepartmentTranslate) {
		return ContextHolder.getBean(UsDepartmentTranslateDao.class).insertByCode(insertUsDepartmentTranslate);
	}
	
	@Override
	@Transactional
	public int updateByCode(UsDepartmentTranslateDto updateUsDepartmentTranslate) {
		return ContextHolder.getBean(UsDepartmentTranslateDao.class).updateByCode(updateUsDepartmentTranslate);
	}

	@Override
	@Transactional
	public int deleteByIds(UsDepartmentTranslateDto deleteUsDepartmentTranslate) {
		return ContextHolder.getBean(UsDepartmentTranslateDao.class).deleteByIds(deleteUsDepartmentTranslate);
	}

	@Override
	public <P> P findById(Class<P> mappedClass, UsDepartmentTranslateDto findUsDepartmentTranslate) {
		return ContextHolder.getBean(UsDepartmentTranslateDao.class).findById(mappedClass, findUsDepartmentTranslate);
	}

	@Override
	public <P> List<P> findListByLikeCode(Class<P> mappedClass, UsDepartmentTranslateDto findListUsDepartmentTranslate) {
		return ContextHolder.getBean(UsDepartmentTranslateDao.class).findListByLikeCode(mappedClass, findListUsDepartmentTranslate);
	}

	@Override
	public <P> List<P> findList(Class<P> mappedClass) {
		return ContextHolder.getBean(UsDepartmentTranslateDao.class).findList(mappedClass);
	}

	@Override
	public <P> PaginationDto<P> paginationByLikeCode(Class<P> mappedClass, UsDepartmentTranslateDto paginationUsDepartmentTranslate) {
		return ContextHolder.getBean(UsDepartmentTranslateDao.class).paginationByLikeCode(mappedClass, paginationUsDepartmentTranslate);
	}
}